# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=gnome-documents
pkgver=3.34.0+34+g678141fa
pkgrel=1
pkgdesc="A document manager application for GNOME"
url="https://wiki.gnome.org/Apps/Documents"
arch=(x86_64)
license=(GPL)
depends=(evince gjs gtk3 gnome-desktop gnome-online-accounts libgdata
         tracker-miners libzapojit webkit2gtk gnome-online-miners librsvg
         libgepub gnome-epub-thumbnailer)
makedepends=(gobject-introspection git meson yelp-tools inkscape)
optdepends=('libreoffice-fresh: Support for Libreoffice document types')
groups=(gnome-extra)
_commit=678141fa4cdce0af0baccff965c27734b0c4546b  # master
source=("git+https://gitlab.gnome.org/GNOME/gnome-documents.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgd.git"
        0001-getting-started-Fix-the-build-with-inkscape-1.0.patch)
sha256sums=('SKIP'
            'SKIP'
            '9c7dea42e61b179c780795ae3441ec92a06d5660242649f39aaf441d0b1bb6c0')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  # https://bugs.archlinux.org/task/67942
  git apply -3 ../0001-getting-started-Fix-the-build-with-inkscape-1.0.patch

  git submodule init
  git submodule set-url subprojects/libgd "$srcdir/libgd"
  git submodule update
}
  

build() {
  arch-meson $pkgname build -D getting_started=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 et:
